
use "absInt.sml";

val ast1 = BJKParser.parse("../SamplePrograms/amir1.core");
val ast2 = BJKParser.parse("../SamplePrograms/amir2.core");
val ast3 = BJKParser.parse("../SamplePrograms/amir3.core");
val ast31 = BJKParser.parse("../SamplePrograms/amir3.1.core");
val ast4 = BJKParser.parse("../SamplePrograms/amir4.core");
val ast5 = BJKParser.parse("../SamplePrograms/sample1.core");
val ast6 = BJKParser.parse("../SamplePrograms/sample2.core");

CG.debug := false;
val ast = ast6;

print("============================================\n" ^
      "analysed program:\n" ^
      (Core.prt ast) ^
      "============================================\n"); 

val g = AbstractInterpreter.analyse(ast);

print("New abstract interpreter algorithm analysis result:\n" ^
	  CG.prtEdges(g) ^
      "============================================\n");
print("Original BJK algorithm Poly analysis result:\n" ^ 
	  CG.prtDfr(Pol.analyse(ast)) ^ 
	  "\n============================================\n"); 
	  